BUUCTF Reverse WriteUp 3
ACTF rome
The x86 executable expects an ACTF{...} input. Inside the braces, it shifts uppercase and lowercase letters separately, then compares the 16 transformed characters with a hard-coded array. The name “rome” is a useful hint.
1 | int func() |
The transformation operates on one character at a time, so I tried the possible characters at each position and kept the one that matched:
1 | import string |
Cae3ar_th4_Gre@t
CrackMe
This x86 executable is not packed. Its main function asks for an alphanumeric username and password, passes them to sub_401830, and combines that result with another check before printing a message:
1 | int wmain() |
I followed the program in OllyDbg as far as sub_401830, checking whether either input had been changed before the call.

Neither had changed, so the interesting work must happen inside the function:
1 | bool __usercall check@<al>(int a1@<ebx>, int username, const char *password) |
That decompilation is a mess. The first part seems to turn the password into bytes, while a table is repeatedly rearranged below it. I could not make the trace agree with my expectations until another writeup pointed out the anti-debugging check: the program behaves differently when a debugger is present.
At the end, data2 needs to equal dbappsec. To work backward from that comparison, I first simulated the changing 272-element table:
1 | data = [ |
['N', 'µ', 'ó', '\x99', '#', '\x91', '¡', '®']: can anyone actually type that?
That result did not look like a password I could type. The XOR values depend on the debugger state but are otherwise fixed, so I went back to trace them individually.
0x7e 0x98 0xc9 0x95 0x10 0x6d 0xf3 0x67
Still unconvinced, I checked the same steps in OllyDbg.
0x2a, 0xd7, 0x92, 0xe9, 0x53, 0xe2, 0xc4, 0xcd
The debugger actually agrees with my simulation: ['N', 'µ', 'ó', '\x99', '#', '\x91', '¡', '®'].
Hang on—the program converts the input into bytes, so those values can be entered as hex: 4eb5f3992391a1ae.
That still did not seem to be enough: a later branch also XORs the value with the username. I tried accounting for that too:
1 | import hashlib |
39d09ffa4cfcc4cc passes my test, but neither the MD5 of the bytes nor the MD5 of that text is accepted as the answer.

Why? I have already closed IDA and OllyDbg!
An online lookup gave me d2be2981b84f2a905669995873d6a36c, the MD5 of my earlier value, 4eb5f3992391a1ae.
That one is accepted! Apparently the username-XOR branch is not executed in the relevant run. What a strange challenge.
firmware
This is router firmware, a subject I had not studied. After trying tutorials and reinstalling binwalk according to the official instructions, I found a file called backdoor under /tmp and inspected it.
It is UPX-packed. After unpacking, the long main function confirms it is a backdoor.
The connection routine identifies the backdoor’s server address. Its connection code and endpoint are omitted here; they are part of the malware sample.
xxor
The Linux x86-64 binary asks for six integers, encrypts them in pairs, and then checks the resulting values. It even tells us to convert the input to hex and join it at the end:
1 | __int64 __fastcall main(__int64 a1, char **a2, char **a3) |
Each pair of 32-bit inputs occupies one 64-bit slot. After encrypt transforms the pairs, check determines whether they match the required result. I started with that final check.
Here is check:
1 | signed __int64 __fastcall check(_DWORD *a1) |
The comparisons amount to a small system of equations. A calculator would do, but this is a good excuse to install Z3 for later challenges.
[x = 3774025685, y = 1548802262, z = 2652626477]
The six encrypted numbers are:
a = {0xDF48EF7E, 0x20CAACF4, 0xe0f30fd5, 0x5c50d8d6, 0x9e1bde2d, 0x84F30420}
With those six target values in hand, I wrote a Java program to reverse the transformation:
1 |
|
[-698534522, -1541066437, 1578206992, -287775654, 1339222190, -130761337] is incorrect.
The negative values are a clue: Java’s int is signed. I rewrote the calculation in C to handle the values as needed:
1 |
|
666c61, 677b72,655f69, 735f67,726561, 74217d
Convert the hex to a string: flag{re_is_great!}.
That completes all of the one-point BUUCTF challenges. Celebration! ★,°:.☆( ̄▽ ̄)/$:.°★ 。




